﻿using Newtonsoft.Json;
using System.Collections.Generic;

namespace AutomationCommand
{
    public class ppt_pic_option : BasiCommand
    {
        [JsonProperty("fun_type")]
        public string FunType { get; set; }

        [JsonProperty("othername")]
        public string OtherName { get; set; }

        [JsonProperty("slide")]
        public string Slide { get; set; }

        [JsonProperty("option")]
        public string Option { get; set; }

        [JsonProperty("dtpath")]
        public string Dtpath { get; set; }

        [JsonProperty("file")]
        public string File { get; set; }

        [JsonProperty("regx")]
        public string Regx { get; set; }

        [JsonProperty("textout")]
        public List<TextOut> TextOut { get; set; }

        public ppt_pic_option()
        {
            FunType = "ppt_pic_option";
            OtherName = "ppt图片操作";
            Slide = "1";
            Option = "fdata";
            Dtpath = "";
            File = "keyname";
            Regx = ".*";
            TextOut = new List<TextOut>
            {
                new TextOut
                {
                    Regx = ".*",
                    Point = new Point
                    {
                        X = "0",
                        Y = "0"
                    },
                    Size = new Size
                    {
                        W = "10",
                        H = "10"
                    },
                    Line = "0",
                    Color = new Color
                    {
                        Bc = "000000",
                        Fc = "ffffff"
                    },
                    Font = "10"
                }
            };
            SuccessJump = -1;
            FailureJump = -1;
        }

        public bool Execute()
        {
            // 在这里编写执行PPT图片操作命令的逻辑
            // 返回执行结果
            return true; // 假设此处始终成功
        }
    }

    public class TextOut
    {
        [JsonProperty("regx")]
        public string Regx { get; set; }

        [JsonProperty("point")]
        public Point Point { get; set; }

        [JsonProperty("size")]
        public Size Size { get; set; }

        [JsonProperty("line")]
        public string Line { get; set; }

        [JsonProperty("color")]
        public Color Color { get; set; }

        [JsonProperty("font")]
        public string Font { get; set; }
    }
}
